/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "stdafx.h"
#include "几何平面网格.h"


void f_graph_构建平面顶点(vec2 size, uvec2 细分, DEF_3Fs& V, E_轴向 轴向 = E_轴向::e_Y) {
	vec2 offset = size / 细分;

	uint32 offsetIndex = 0;
	vec3 负方向偏移 = { size.x * 0.5f, 0.0f, size.y * 0.5f };
	for (uint32 y = 0; y < 细分.y; ++y) {
		for (uint32 x = 0; x < 细分.x; ++x) {
			vec3 顶点 = {};
			vec2 UV;

			顶点.x = x * offset.x;
			顶点.z = y * offset.y;
			V[offsetIndex] = 顶点 - 负方向偏移;
			//p_Normal[offsetIndex] = {0,1,0};
			//
			//UV.x = x / 细分.x;
			//UV.y = y / 细分.y;
			//p_UV[offsetIndex] = UV;

			++offsetIndex;
		}
	}

}






